package com.szqhyxj.youxiangju.biz.merchantHome.net;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.szqhyxj.youxiangju.R;
import com.szqhyxj.youxiangju.biz.merchantHome.my.MyModel;
import com.szqhyxj.youxiangju.biz.merchantHome.notice.NoticeModel;
import com.szqhyxj.youxiangju.sys.components.view.popview.BaseDialog;
import com.szqhyxj.youxiangju.sys.util.NetWorkUtils;

/**
 * leung
 * on 2018/12/11
 */
public class NetPopView extends BaseDialog {
    LinearLayout netLin;
    Button retry;
    int net;
    RetryClickListener retryClickListener;
    public NetPopView(Context context,RetryClickListener retryClickListener) {
        super(context);
        this.retryClickListener = retryClickListener;
        DisplayMetrics dm = context.getResources().getDisplayMetrics();
        int screenWidth = dm.widthPixels;
        int screenHeight = dm.heightPixels;
        ViewGroup.LayoutParams lp;
        lp = netLin.getLayoutParams();
        lp.width = screenWidth;
        lp.height = screenHeight;
        netLin.setLayoutParams(lp);
        net = NetWorkUtils.getAPNType(context);
    }


    @Override
    protected View initDialogView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.popview_net, null);
        netLin = view.findViewById(R.id.netlin);
        retry = view.findViewById(R.id.retry);
        retry.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                retryClickListener.onClickItem();
            }
        });
        return view;
    }

    public interface RetryClickListener {
        void onClickItem();
    }



}



